void main(List<String> args) {
    // int a = 10;
    // a+=1;
    // double b = 10.5;
    // var c=a*b;
    // print(c);
    // print(a);
    // print(add(2,4));
    print(greet('开大会','汪汪队'));
}

//num里面包含int和double，所以可以传入int和double，可以类型转换
int add(int a,int b){
  return a+b;
}

String greet(String name,[String? greeting='Hello']){
  return '$greeting,$name';
}

class Person{
  String name;
  int age;
  //构造函数
  Person(this.name,this.age);
  //方法
  void sayHello(){
    print('Hello,I am $name,I am $age years old');
  }
}

//继承
class Student extends Person{
  String major;
  //构造函数
  Student(String name,int age,this.major):super(name,age);
  //方法
  @override
  void sayHello(){
    print('I am studying');
  }
}
//调用
var student = Student('小明',20,'计算机');